package util;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author caosinuo
 * @date 2019/5/22 14:57
 */
@Component
public class RedisUtil {
  /* @Resource
   private RedisTemplate<String, String> redisTemplate;

   public void set(String key, String value) {
      ValueOperations<String, String> valueOperations = redisTemplate.opsForValue();
      valueOperations.set(key, value);
   }

   public void setex(String key, String value, int seconds) {
      ValueOperations<String, String> valueOperations = redisTemplate.opsForValue();
      valueOperations.set(key, value, seconds);
   }*/
  private ConcurrentHashMap<String, String> redisTemplate;


  public void set(String key, String value) {
     redisTemplate.put(key,value);
  }

   public void set(String key, String value, int seconds) {
      redisTemplate.put(key,value);
   }


}
